package com.whw.fy.service.impl;

import com.whw.fy.entity.Message;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import com.whw.fy.mapper.LessonMapper;
import com.whw.fy.entity.Lesson;
import com.whw.fy.service.LessonService;import java.util.List;

@Service
public class LessonServiceImpl implements LessonService {

    @Resource
    private LessonMapper lessonMapper;

    @Override
    public Message deleteByPrimaryKey(Integer lessonId) {
        return lessonMapper.deleteByPrimaryKey(lessonId) > 0 ? Message.success(null) : Message.fail(null);
    }



    @Override
    public Message insertSelective(Lesson record) {
        return lessonMapper.insertSelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }

    @Override
    public Message selectByPrimaryKey(Integer lessonId) {
        return Message.success(null).add(lessonMapper.selectByPrimaryKey(lessonId));
    }

    @Override
    public Message updateByPrimaryKeySelective(Lesson record) {
        return lessonMapper.updateByPrimaryKeySelective(record) > 0 ? Message.success(null) : Message.fail(null);
    }



    @Override
    public Message selectAll() {
        return Message.success(null).add(lessonMapper.selectAll());
    }

    @Override
    public int batchInsert(List<Lesson> list) {
        return lessonMapper.batchInsert(list);
    }
}

